package icu.qx.pbs.feign;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.system.api.domain.SysUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
@FeignClient(value = "ruoyi-system", contextId = "UserService")
public interface SysUserFeign {
    /**
     * 根据用户编号获取详细信息
     */
    @RequiresPermissions("system:user:query")
    @GetMapping(value = {"/user/myUser/{userId}"})
    public AjaxResult myUser(@PathVariable("userId") Long userId);

    /**
     * 通过id获取名字
     */
    @GetMapping("/user/username/{userId}")
    public R<SysUser> username(@PathVariable("userId") Long userId);
}
